- render_standard_signin = admin_mode ? allow_admin_mode_password_authentication_for_web? : password_authentication_enabled_for_web?

= gl_tabs_nav({ class: '-gl-mx-5 gl-my-5 nav-justified', id: 'js-signin-tabs' }) do
  - if crowd_enabled?
    = gl_tab_link_to _('Crowd'), '#crowd', { item_active: form_based_auth_provider_has_active_class?(:crowd), data: { toggle: 'tab' } }

  - ldap_servers.each_with_index do |server, i|
    = gl_tab_link_to server['label'], "##{server['provider_name']}", { item_active: i == 0 && form_based_auth_provider_has_active_class?(:ldapmain), data: { toggle: 'tab', testid: 'ldap-tab' } }

  = render_if_exists 'devise/shared/tab_smartcard'

  - if render_standard_signin
    = gl_tab_link_to _('Standard'), '#login-pane', { data: { toggle: 'tab', testid: 'standard-tab' } }

.tab-content
  - if crowd_enabled?
    .tab-pane{ id: 'crowd', role: 'tabpanel', class: active_when(form_based_auth_provider_has_active_class?(:crowd)) }
      = render 'devise/sessions/new_crowd', admin_mode: admin_mode

  - ldap_servers.each_with_index do |server, i|
    .tab-pane{ id: server['provider_name'], role: 'tabpanel', class: active_when(i == 0 && form_based_auth_provider_has_active_class?(:ldapmain)) }
      = render 'devise/sessions/new_ldap', server: server, admin_mode: admin_mode

  = render_if_exists 'devise/sessions/new_smartcard'

  - if render_standard_signin
    .tab-pane{ id: 'login-pane', role: 'tabpanel' }
      = render 'devise/sessions/new_base', admin_mode: admin_mode
